"use strict";

/**★Mike Chen Builder★**/

/**数据计算类的功能*/
let {maxNum, minNum, sum, sumEx} = require('./ToolsCollection/Calculation');

/**数据检测类的功能*/
let {DataTypeDetect, emptyObjectDetect, emptyArrayDetect, notEmptyDetect} = require('./ToolsCollection/DataDetect');

/**数据查找类的功能*/
let {findString, findStringEx, findMultiEqualString} = require('./ToolsCollection/DataSearch');

/**数据转换输出类的功能*/
let {arrayRemoveDump, anyDataConvertBase64, EraseMatchArrayItems} = require('./ToolsCollection/DataConvert');

/**随机生成类的功能*/
let {randomStringMaker, randomStringMakerEx, randomSelectBoolean, randomMacGenerator} = require('./ToolsCollection/RandomDataGeneration');

/**系统处理类的功能*/
let {
    sleep_Async,
    sleep_Nsync,
    createDirectory,
    getFullPathFileOrDirectoryName,
    getFileNameExtName,
    getFileOnDirectoryLocation,
    getCusFmtTimeDate,
    getCustomFormatTimeDate,
    getCurrentHostName,
    getCurrentHostIPAddress,
    getCurrentDisplayLanguage,
    getAllStorageDevice,
    nodeModulePluginsObjectBuilder,
    rmData,
    SpecialReservedCharacterDetect,
    getCurrentShellScriptPath,
    getCurrentEnvironmentSimpleInfo,
    RuntimeMemoryInfo,
    hostCheck,
    portRange,
    isExecProgramDetect,
    zip_DeCompress,
    zip_EnCompress
} = require('./ToolsCollection/SystemProcess');

/**服务处理类的功能*/
let {
    clientRequestBaseInfo,
    getRequestMiddlewareData,
    getClientRequestData,
    makeResponseHeaderInfo,
    webServerFileUpdateModule,
    webServerDataUpdate,
    wakeUpCurrentNetworkPointHost,
    wakeUpCurrentNetworkALLHost
} = require('./ToolsCollection/ServerProcess');

/**General Tools Collection Package Kit，通用工具集合套件包，NodeJS后端版*/
class GeneralToolsCollectionPackageKit {
    anyDataConvertBase64 = anyDataConvertBase64;
    arrayRemoveDump = arrayRemoveDump;
    createDirectory = createDirectory;
    clientRequestBaseInfo = clientRequestBaseInfo;
    DataTypeDetect = DataTypeDetect;
    emptyObjectDetect = emptyObjectDetect;
    emptyArrayDetect = emptyArrayDetect;
    EraseMatchArrayItems = EraseMatchArrayItems;
    findString = findString;
    findStringEx = findStringEx;
    findMultiEqualString = findMultiEqualString;
    FileStream = require('fs');
    PathStream = require('path');
    getCurrentHostName = getCurrentHostName;
    getCusFmtTimeDate = getCusFmtTimeDate;
    getAllStorageDevice = getAllStorageDevice;
    getCustomFormatTimeDate = getCustomFormatTimeDate;
    getClientRequestData = getClientRequestData;
    getFullPathFileOrDirectoryName = getFullPathFileOrDirectoryName;
    getCurrentShellScriptPath = getCurrentShellScriptPath;
    getFileNameExtName = getFileNameExtName;
    getFileOnDirectoryLocation = getFileOnDirectoryLocation;
    getCurrentHostIPAddress = getCurrentHostIPAddress;
    getCurrentDisplayLanguage = getCurrentDisplayLanguage;
    getCurrentEnvironmentSimpleInfo = getCurrentEnvironmentSimpleInfo;
    getRequestMiddlewareData = getRequestMiddlewareData;
    hostCheck = hostCheck;
    isExecProgramDetect = isExecProgramDetect;
    maxNum = maxNum;
    minNum = minNum;
    makeResponseHeaderInfo = makeResponseHeaderInfo;
    nodeModulePluginsObjectBuilder = nodeModulePluginsObjectBuilder;
    notEmptyDetect = notEmptyDetect;
    portRange = portRange;
    randomStringMaker = randomStringMaker;
    randomStringMakerEx = randomStringMakerEx;
    randomSelectBoolean = randomSelectBoolean;
    randomMacGenerator = randomMacGenerator;
    RuntimeMemoryInfo = RuntimeMemoryInfo;
    rmData = rmData;
    sleep = {sleep_Async, sleep_Nsync};
    SpecialReservedCharacterDetect = SpecialReservedCharacterDetect;
    sum = sum;
    sumEx = sumEx;
    webServerFileUpdateModule = webServerFileUpdateModule;
    webServerDataUpdate = webServerDataUpdate;
    wakeUpCurrentNetworkPointHost = wakeUpCurrentNetworkPointHost;
    wakeUpCurrentNetworkALLHost = wakeUpCurrentNetworkALLHost;
    zip_EnCompress = zip_EnCompress;
    zip_DeCompress = zip_DeCompress;

    /**深拷贝实例函数*/
    DeepCopyInstance = function (InstanceSource) {
        try {
            let Origin1 = JSON.stringify(InstanceSource);
            let Origin2 = JSON.parse(Origin1);
            return Origin2;
        } catch (e) {
            return InstanceSource;
        }
    };

    /**浅拷贝函数
     * @deprecated*/
    lightCopy = function (NeedCopySources) {
        return NeedCopySources;
    };
}

module.exports = {
    GeneralToolsCollectionPackageKit,
    anyDataConvertBase64,
    arrayRemoveDump,
    clientRequestBaseInfo,
    EraseMatchArrayItems,
    findString,
    findStringEx,
    findMultiEqualString,
    getAllStorageDevice,
    getClientRequestData,
    getCurrentDisplayLanguage,
    getCurrentEnvironmentSimpleInfo,
    hostCheck,
    isExecProgramDetect,
    makeResponseHeaderInfo,
    maxNum,
    minNum,
    notEmptyDetect,
    portRange,
    RuntimeMemoryInfo,
    rmData,
    randomSelectBoolean,
    randomMacGenerator,
    randomStringMakerEx,
    randomStringMaker,
    sleep_Async,
    sleep_Nsync,
    sum,
    sumEx,
    zip_EnCompress,
    zip_DeCompress
};